package de.koller.million.grid.commands;

import de.koller.million.grid.GNode;
import de.koller.aframe.util.thread.ICommand;
import de.koller.oceanFramework.OceanException;

public class AddGNode implements ICommand {

	private final GNode node;
	private final GNode toAdd;

	/** node.addchild( toAdd ) */
	public AddGNode( GNode node, GNode toAdd ) {
		if( toAdd.isInitialized() )
			throw new OceanException( "node is initialized!" );
		this.node = node;
		this.toAdd = toAdd;
	}
	
	@Override
	public void handle( Object... params ) {
		node.addChild( toAdd );
	}
	
}
